import EUI from 'element-ui'
const $message = EUI.Message
export default {
  success: function (msg, opt) {
    const $opt = Object.assign({}, {duration: 2000}, opt)
    $message({
      duration: $opt.duration,
      showClose: true,
      message: msg,
      type: 'success'
    })
  },
  error: function (msg, opt) {
    const $opt = Object.assign({}, {duration: 2000}, opt)
    $message({
      duration: $opt.duration,
      showClose: true,
      message: msg,
      type: 'error'
    })
  },
  warning: function (msg, opt) {
    const $opt = Object.assign({}, {duration: 2000}, opt)
    $message({
      duration: $opt.duration,
      showClose: true,
      message: msg,
      type: 'warning'
    })
  }
}
